﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using kim.Common;

namespace kim
{
    public partial class ProductClassList : kim.UI.ManagePage
    {

        protected int typeid;
        protected void Page_Load(object sender, EventArgs e)
        {
            typeid = KIMRequest.GetInt("typeid", 1);
            Label1.Text = "案例分类";
            GetProductClass();
        }
        private void GetProductClass()
        {
            DataTable dt = new BLL.CClass().GetList(0, typeid);
            this.rptlist.DataSource = dt;
            this.rptlist.DataBind();
        }
        // 美化列表
        protected void rptList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                Literal LitFirst = (Literal)e.Item.FindControl("LitFirst");
                HiddenField hidLayer = (HiddenField)e.Item.FindControl("hidLayer");
                string LitStyle = "<span style=margin-left:{0}px;text-align:right;display:inline-block;>{1}{2}</span>";
                string LitImg1 = "<img src=../images/folder_open.gif align=absmiddle />";
                string LitImg2 = "<img src=../images/t.gif align=absmiddle />";

                int classLayer = Convert.ToInt32(hidLayer.Value);
                if (classLayer == 1)
                {
                    LitFirst.Text = LitImg1;
                }
                else
                {
                    LitFirst.Text = string.Format(LitStyle, classLayer * 10, LitImg2, LitImg1);
                }
            }
        }

    }
}